package com.lqg.bookLibrary.pojo;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author prodigal_lqg
 * @since 2023-04-09 
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("users")
public class Users implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @TableId("user_id")
    private Long userId;

    /**
     * 用户名称
     */
    @TableField(value = "username")
    private String username;

    /**
     * 用户密码
     */
    @TableField("password")
    private String password;

    /**
     * 用户性别(1男 0 女)
     */
    @TableField("sex")
    private Integer sex;

    /**
     * 用户邮箱
     */
    @TableField("email")
    private String email;

    /**
     * 头像
     */
    @TableField("photo")
    private String photo;

    /**
     * 用户电话
     */
    @TableField("phone")
    private String phone;

    /**
     * 权限列表
     */
    @TableField("role")
    private String role;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 最后更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;


    public Users(String username, String password) {
        this.username = username;
        this.password = password;
    }

}
